﻿// Type: Crystalbyte.Equinox.Imap.IMessageQueryable
// Assembly: Crystalbyte.Equinox.Imap, Version=0.4.4493.24531, Culture=neutral, PublicKeyToken=null
// Assembly location: C:\Experiments\TFSAzure\FetchAndProcess\Common\ThirdPartyLibs\Release\Crystalbyte.Equinox.Imap.dll

using Crystalbyte.Equinox;
using Crystalbyte.Equinox.Imap.Processing;
using Crystalbyte.Equinox.Mime;
using System;
using System.Collections.Generic;

namespace Crystalbyte.Equinox.Imap
{
    public interface IMessageQueryable
    {
        [Fetchable]
        object Parts(string level);

        bool IsOld { get; }
        bool IsNew { get; }
        IEnumerable<string> Keywords { get; }

        [Fetchable(Identifier = "From", IsHeader = true, ParserType = typeof (ContactCollectionParser), ReaderType = typeof (FromHeaderReader))]
        IEnumerable<EmailContact> From { get; }

        [Fetchable(Identifier = "To", IsHeader = true, ParserType = typeof (ContactCollectionParser), ReaderType = typeof (ToHeaderReader))]
        IEnumerable<EmailContact> To { get; }

        [Fetchable(Identifier = "Bcc", IsHeader = true, ParserType = typeof (ContactCollectionParser), ReaderType = typeof (BccHeaderReader))]
        IEnumerable<EmailContact> Bcc { get; }

        [Fetchable(Identifier = "Cc", IsHeader = true, ParserType = typeof (ContactCollectionParser), ReaderType = typeof (CcHeaderReader))]
        IEnumerable<EmailContact> Cc { get; }

        [Fetchable(Identifier = "Date", IsHeader = true, ParserType = typeof (DateParser), ReaderType = typeof (DateHeaderReader))]
        DateTime Date { get; }

        [Fetchable(Identifier = "Subject", IsHeader = true, ParserType = typeof (TextParser), ReaderType = typeof (SubjectHeaderReader))]
        string Subject { get; }

        [Fetchable(Identifier = "ENVELOPE", IsInline = true, ParserType = typeof (EnvelopeParser), ReaderType = typeof (EnvelopeReader))]
        Envelope Envelope { get; }

        [Fetchable(Identifier = "BODYSTRUCTURE", IsInline = false, ParserType = typeof (BodyStructParser), ReaderType = typeof (BodyStructReader))]
        MessageInfo BodyStructure { get; }

        [Fetchable(Identifier = "FLAGS", IsInline = true, ParserType = typeof (FlagsParser), ReaderType = typeof (FlagsReader))]
        MessageFlags Flags { get; }

        [Fetchable(Identifier = "UID", IsInline = true, ParserType = typeof (UidParser), ReaderType = typeof (UidReader))]
        int Uid { get; }

        [Fetchable(Identifier = "BODY[HEADER]", ParserType = typeof (HeaderCollectionParser), ReaderType = typeof (HeaderCollectionReader))]
        IEnumerable<HeaderField> Headers { get; }

        [Fetchable(Identifier = "BODY[TEXT]", ParserType = typeof (TextParser), ReaderType = typeof (TextReader))]
        string Text { get; }

        [Fetchable(Identifier = "SN", IsInline = true, IsSequenceNumber = true, ParserType = typeof (IntParser), ReaderType = typeof (SequenceNumberReader))]
        int SequenceNumber { get; }

        [Fetchable(Identifier = "RFC822.SIZE", IsInline = true, ParserType = typeof (SizeParser), ReaderType = typeof (SizeReader))]
        Size Size { get; }

        [Fetchable(Identifier = "INTERNALDATE", IsInline = true, ParserType = typeof (DateParser), ReaderType = typeof (InternalDateReader))]
        DateTime InternalDate { get; }
    }
}
